﻿using System;

namespace DiveDeeper.VsxLibrary.Core
{
  // ==================================================================================
  /// <summary>
  /// This attribute class defines the Command Id of a menu command.
  /// </summary>
  // ==================================================================================
  [AttributeUsage(AttributeTargets.Class)]
  public sealed class CommandIDAttribute : Attribute
  {
    #region Private fields

    private readonly Guid _Guid;
    private readonly uint _Command;

    #endregion

    #region Lifecycle methods

    // ------------------------------------------------------------------------------
    /// <summary>
    /// Creates a new instance of the attribute with the specified initial values.
    /// </summary>
    /// <param name="guid">Command set guid</param>
    /// <param name="command">Command identifier.</param>
    // ------------------------------------------------------------------------------
    public CommandIDAttribute(string guid, uint command)
    {
      _Guid = new Guid(guid);
      _Command = command;
    }

    #endregion

    #region Public properties

    // ------------------------------------------------------------------------------
    /// <summary>
    /// Gets the Guid part ofthe command ID.
    /// </summary>
    // ------------------------------------------------------------------------------
    public Guid Guid
    {
      get { return _Guid; }
    }

    // ------------------------------------------------------------------------------
    /// <summary>
    /// Gets the uint part ofthe command ID.
    /// </summary>
    // ------------------------------------------------------------------------------
    public uint Command
    {
      get { return _Command; }
    }

    #endregion
  }
}
